package cn.shengchao.rule.condition;

import cn.hutool.core.util.StrUtil;
import cn.shengchao.rule.condition.paramKey.IConditionParamKey;
import cn.shengchao.rule.engine.RuleElementContainer;
import lombok.Data;

import java.util.Map;

/**
 * @program: examstarapi
 * @description: 注册日期区间条件
 * @author: Xiong weiqiang
 * @create: 2025-04-11 17:57
 */
@Data
public class VipLevelsCondition extends ICondition{

    @Override
    public IConditionParamKey getParameterKey() {
        return RuleElementContainer.getConditionParamKey(IConditionParamKey.VIP_LEVELS);
    }

    @Override
    public boolean isMatch(Map<String,String> targetValueMap) {
        String targetValue=targetValueMap.get(IConditionParamKey.VIP_LEVELS);
        if (StrUtil.isBlank(targetValue)){
            return false;
        }
        return super.isMatch(targetValue,getMatchValue());
    }

    @Override
    public int getPriority() {
        return 2;
    }
}